package com.example.Laboratory.Service.Impl;

import com.example.Laboratory.Entity.Achievements_thesis;
import com.example.Laboratory.Mapper.Achievements_thesisMapper;

import com.example.Laboratory.Service.Achievements_thesisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Achievements_thesisServiceImpl implements Achievements_thesisService {

    @Autowired
    Achievements_thesisMapper achievements_thesisMapper;

    //增加科研成果-论文信息
    @Override
    public String addAchievements_thesis(Achievements_thesis t) {
        if (achievements_thesisMapper.addAchievements_thesis(t) == 1) {
            return "添加成功";
        } else {
            return "添加失败";
        }
    }

    //根据id删除信息
    @Override
    public String deleteAchievements_thesis(int achievements_thesis_id) {
        if (achievements_thesisMapper.deleteAchievements_thesis(achievements_thesis_id) == 1) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }

    //查找全表信息
    @Override
    public List<Achievements_thesis> researchAchievements_thesis() {
        return achievements_thesisMapper.researchAchievements_thesis();
    }

    //修改信息
    @Override
    public String reviseAchievements_thesis(Achievements_thesis t) {
        if (achievements_thesisMapper.reviseAchievements_thesis(t) == 1) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }
}
